﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Aeon.Presentation.Dialogs;assembly=Aeon.Presentation">
    <ControlTemplate x:Key="taskButtonTemplate" TargetType="{x:Type local:TaskDialogItem}">
        <Grid Name="topGrid" Background="Transparent" Cursor="Hand">
            <Rectangle Name="border" Opacity="0" Stroke="DarkBlue" StrokeThickness="1" RadiusX="3" RadiusY="3">
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1" Opacity="0.5">
                        <GradientStop Color="Transparent" Offset="-1.5" />
                        <GradientStop Color="SkyBlue" Offset="0.5" />
                        <GradientStop Color="Transparent" Offset="2.5" />
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <Grid Margin="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Image Source="{TemplateBinding Icon}" VerticalAlignment="Center" />
                <TextBlock Text="{TemplateBinding Text}" Grid.Column="1" FontSize="16" Margin="5,1" Foreground="Navy" />
                <TextBlock Text="{TemplateBinding Description}" Grid.Column="1" Grid.Row="1" TextWrapping="Wrap" Margin="5,1" Foreground="Navy" />
            </Grid>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True" SourceName="topGrid">
                <Trigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="border" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.25" />
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="border" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.25" />
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.ExitActions>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    
    <Style TargetType="{x:Type local:TaskDialogItem}">
        <Setter Property="Template" Value="{StaticResource taskButtonTemplate}" />
        <Setter Property="Icon" Value="../Resources/TaskArrow.png" />
    </Style>
</ResourceDictionary>